﻿using LightFactory;

namespace NFactorySample
{
    public class RealFactory: FactoryBase
    {
        protected override void InitFactory()
        {
            Define<ICompany>(() => new RealCompany());
            Define<ICompany, string>(companyName => new RealCompany(companyName));

            Define<IPerson, string, string, int>((firstName, lastName, age) =>
                new RealPerson()
                {
                    FirstName = firstName,
                    LastName = lastName,
                    Age = age
                });
        }
    }

    public class TestFactory: FactoryBase
    {
        protected override void InitFactory()
        {
            Define<ICompany>(() => new TestCompany());
            Define<IPerson>(() => new TestPerson());
        }
    }
}
